Optimal. Leaf size=100 \[ \frac{a^3 (A+B)}{8 d (a-a \sin (c+d x))^2}-\frac{a^2 (A-B)}{8 d (a \sin (c+d x)+a)}+\frac{a^2 A}{4 d (a-a \sin (c+d x))}+\frac{a (3 A-B) \tanh ^{-1}(\sin (c+d x))}{8 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.122077, antiderivative size = 100, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 29, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.103, Rules used = {2836, 77, 206} \[ \frac{a^3 (A+B)}{8 d (a-a \sin (c+d x))^2}-\frac{a^2 (A-B)}{8 d (a \sin (c+d x)+a)}+\frac{a^2 A}{4 d (a-a \sin (c+d x))}+\frac{a (3 A-B) \tanh ^{-1}(\sin (c+d x))}{8 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2836
Rule 77
Rule 206
Rubi steps
\begin{align*} \int \sec ^5(c+d x) (a+a \sin (c+d x)) (A+B \sin (c+d x)) \, dx &=\frac{a^5 \operatorname{Subst}\left (\int \frac{A+\frac{B x}{a}}{(a-x)^3 (a+x)^2} \, dx,x,a \sin (c+d x)\right )}{d}\\ &=\frac{a^5 \operatorname{Subst}\left (\int \left (\frac{A+B}{4 a^2 (a-x)^3}+\frac{A}{4 a^3 (a-x)^2}+\frac{A-B}{8 a^3 (a+x)^2}+\frac{3 A-B}{8 a^3 \left (a^2-x^2\right )}\right ) \, dx,x,a \sin (c+d x)\right )}{d}\\ &=\frac{a^3 (A+B)}{8 d (a-a \sin (c+d x))^2}+\frac{a^2 A}{4 d (a-a \sin (c+d x))}-\frac{a^2 (A-B)}{8 d (a+a \sin (c+d x))}+\frac{\left (a^2 (3 A-B)\right ) \operatorname{Subst}\left (\int \frac{1}{a^2-x^2} \, dx,x,a \sin (c+d x)\right )}{8 d}\\ &=\frac{a (3 A-B) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac{a^3 (A+B)}{8 d (a-a \sin (c+d x))^2}+\frac{a^2 A}{4 d (a-a \sin (c+d x))}-\frac{a^2 (A-B)}{8 d (a+a \sin (c+d x))}\\ \end{align*}
Mathematica [C] time = 1.52678, size = 357, normalized size = 3.57 \[ \frac{a (\sin (c+d x)+1) \left (i x (3 A-B) \left (\sin \left (\frac{1}{2} (c+d x)\right )+\cos \left (\frac{1}{2} (c+d x)\right )\right )^2+\frac{2 (A+B) \left (\sin \left (\frac{1}{2} (c+d x)\right )+\cos \left (\frac{1}{2} (c+d x)\right )\right )^2}{d \left (\cos \left (\frac{1}{2} (c+d x)\right )-\sin \left (\frac{1}{2} (c+d x)\right )\right )^4}-\frac{2 (3 A-B) \left (\sin \left (\frac{1}{2} (c+d x)\right )+\cos \left (\frac{1}{2} (c+d x)\right )\right )^2 \log \left (\cos \left (\frac{1}{2} (c+d x)\right )-\sin \left (\frac{1}{2} (c+d x)\right )\right )}{d}+\frac{(3 A-B) \left (\sin \left (\frac{1}{2} (c+d x)\right )+\cos \left (\frac{1}{2} (c+d x)\right )\right )^2 \log \left (\left (\sin \left (\frac{1}{2} (c+d x)\right )+\cos \left (\frac{1}{2} (c+d x)\right )\right )^2\right )}{d}-\frac{2 i (3 A-B) \tan ^{-1}\left (\tan \left (\frac{1}{2} (c+d x)\right )\right ) \left (\sin \left (\frac{1}{2} (c+d x)\right )+\cos \left (\frac{1}{2} (c+d x)\right )\right )^2}{d}+\frac{2 (B-A)}{d}+\frac{4 A \left (\sin \left (\frac{1}{2} (c+d x)\right )+\cos \left (\frac{1}{2} (c+d x)\right )\right )^2}{d \left (\cos \left (\frac{1}{2} (c+d x)\right )-\sin \left (\frac{1}{2} (c+d x)\right )\right )^2}\right )}{16 \left (\sin \left (\frac{1}{2} (c+d x)\right )+\cos \left (\frac{1}{2} (c+d x)\right )\right )^4} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.096, size = 173, normalized size = 1.7 \begin{align*}{\frac{aA}{4\,d \left ( \cos \left ( dx+c \right ) \right ) ^{4}}}+{\frac{aB \left ( \sin \left ( dx+c \right ) \right ) ^{3}}{4\,d \left ( \cos \left ( dx+c \right ) \right ) ^{4}}}+{\frac{aB \left ( \sin \left ( dx+c \right ) \right ) ^{3}}{8\,d \left ( \cos \left ( dx+c \right ) \right ) ^{2}}}+{\frac{aB\sin \left ( dx+c \right ) }{8\,d}}-{\frac{aB\ln \left ( \sec \left ( dx+c \right ) +\tan \left ( dx+c \right ) \right ) }{8\,d}}+{\frac{aA\tan \left ( dx+c \right ) \left ( \sec \left ( dx+c \right ) \right ) ^{3}}{4\,d}}+{\frac{3\,aA\sec \left ( dx+c \right ) \tan \left ( dx+c \right ) }{8\,d}}+{\frac{3\,aA\ln \left ( \sec \left ( dx+c \right ) +\tan \left ( dx+c \right ) \right ) }{8\,d}}+{\frac{aB}{4\,d \left ( \cos \left ( dx+c \right ) \right ) ^{4}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.02367, size = 155, normalized size = 1.55 \begin{align*} \frac{{\left (3 \, A - B\right )} a \log \left (\sin \left (d x + c\right ) + 1\right ) -{\left (3 \, A - B\right )} a \log \left (\sin \left (d x + c\right ) - 1\right ) - \frac{2 \,{\left ({\left (3 \, A - B\right )} a \sin \left (d x + c\right )^{2} -{\left (3 \, A - B\right )} a \sin \left (d x + c\right ) - 2 \,{\left (A + B\right )} a\right )}}{\sin \left (d x + c\right )^{3} - \sin \left (d x + c\right )^{2} - \sin \left (d x + c\right ) + 1}}{16 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.81289, size = 439, normalized size = 4.39 \begin{align*} -\frac{2 \,{\left (3 \, A - B\right )} a \cos \left (d x + c\right )^{2} + 2 \,{\left (3 \, A - B\right )} a \sin \left (d x + c\right ) - 2 \,{\left (A - 3 \, B\right )} a -{\left ({\left (3 \, A - B\right )} a \cos \left (d x + c\right )^{2} \sin \left (d x + c\right ) -{\left (3 \, A - B\right )} a \cos \left (d x + c\right )^{2}\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) +{\left ({\left (3 \, A - B\right )} a \cos \left (d x + c\right )^{2} \sin \left (d x + c\right ) -{\left (3 \, A - B\right )} a \cos \left (d x + c\right )^{2}\right )} \log \left (-\sin \left (d x + c\right ) + 1\right )}{16 \,{\left (d \cos \left (d x + c\right )^{2} \sin \left (d x + c\right ) - d \cos \left (d x + c\right )^{2}\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.34597, size = 205, normalized size = 2.05 \begin{align*} \frac{2 \,{\left (3 \, A a - B a\right )} \log \left ({\left | \sin \left (d x + c\right ) + 1 \right |}\right ) - 2 \,{\left (3 \, A a - B a\right )} \log \left ({\left | \sin \left (d x + c\right ) - 1 \right |}\right ) - \frac{2 \,{\left (3 \, A a \sin \left (d x + c\right ) - B a \sin \left (d x + c\right ) + 5 \, A a - 3 \, B a\right )}}{\sin \left (d x + c\right ) + 1} + \frac{9 \, A a \sin \left (d x + c\right )^{2} - 3 \, B a \sin \left (d x + c\right )^{2} - 26 \, A a \sin \left (d x + c\right ) + 6 \, B a \sin \left (d x + c\right ) + 21 \, A a + B a}{{\left (\sin \left (d x + c\right ) - 1\right )}^{2}}}{32 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]